package com.leha.apidemo.web;

import com.leha.apidemo.Utils.APIResult;
import com.leha.apidemo.service.AccountService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by fangzhipeng on 2017/4/20.
 */
@RestController
@RequestMapping("/account")
public class AccountController2 {
    @Autowired
    AccountService accountService;

    @ApiOperation(value = "转账")
    @RequestMapping(value = "transfer", method = RequestMethod.GET)
    public void transfer(){
        accountService.transfer();
    }

    @ApiOperation(value = "获取所有用户")
    @RequestMapping(value="", method = RequestMethod.GET)
    public APIResult getList() {
        return new APIResult(accountService.getList());
    }
}
